package com.lab.utils;


import java.math.BigDecimal;
import java.text.DecimalFormat;

public class NumberUtils {


    public static float parseFloat(String value) {
        try {
            return Float.valueOf(value);
        }catch (Exception e){
            return 0;
        }
    }

    public static String getMoneyFormat(String val) {
        String formattedPrice = "0.00";
        try {
            BigDecimal n = new BigDecimal(val);
            BigDecimal n2 = n.setScale(2, BigDecimal.ROUND_FLOOR);
            formattedPrice = new DecimalFormat("###,##0.00").format(n2);
        } catch (Exception e) {

        }
        return formattedPrice;
    }

}
